#include <bits/stdc++.h>
using namespace std;

void solve(){
	
	int n, m, p, q;
        cin >> n >> m >> p >> q;
        if (p == 1) {
            cout << (m == n * q? "YES" : "NO");
        } else if (p == n) {
            cout << (m == q? "YES" : "NO");
        } else {
            int k = n / p;
            int r = n % p;
            if (r == 0) {
                cout << (m == k * q? "YES" : "NO");
            } else {
                cout << "YES";
            }
        }
} 

int main() {
    int t;
    cin >> t;
    while (t--) {
        solve();
        cout<<endl;
    }
    return 0;
}
